package com.gzu.finalwork.user.mapper;

import com.gzu.finalwork.entity.user.DeliveryOrders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DeliveryOrdersMapper {
    //创建订单
    int createDeliveryOrders(DeliveryOrders deliveryOrders);
    //查询个人所有订单
    List<DeliveryOrders> selectByUserId(Long userId,int limit,int offset);
    List<DeliveryOrders> getByUserId(Long userId);
    //根据订单id查询订单
    DeliveryOrders selectByDeliveryOrderId(Long deliveryOrderId);
    //根据订单id更新订单状态
    int updateStatusByDeliveryOrderId(DeliveryOrders deliveryOrders);
    //根据订单id删除订单
    int deleteByDeliveryOrderId(Long deliveryOrderId);
    //根据订单号查询订单
    DeliveryOrders selectByDeliveryOrderNo(String deliveryOrderNo);
    //统计个人订单数量
    Integer selectCountByUserId(Long userId);
    //根据订单实体查询订单列表
    List<DeliveryOrders> selectByDeliveryOrders(@Param("deliveryOrders")DeliveryOrders deliveryOrders, @Param("limit")int limit, @Param("offset") int offset);

    //统计查询订单数量
    Integer selectCountByDeliveryOrders(@Param("deliveryOrders") DeliveryOrders deliveryOrders);

    //统计查询订单数量
    Integer selectCountByUserIdAndStatus(Long userId, Integer orderStatus);

    //根据订单状态分类查询订单
    List<DeliveryOrders> selectStatusByUserId(Long userId, @Param("limit")int limit, @Param("offset") int offset);
    List<DeliveryOrders> selectStatusProcessingByUserId(Long userId, @Param("limit")int limit, @Param("offset") int offset);
    List<DeliveryOrders> selectStatusDeliveryingByUserId(Long userId, @Param("limit")int limit, @Param("offset") int offset);
    List<DeliveryOrders> selectStatusCompletedByUserId(Long userId, @Param("limit")int limit, @Param("offset") int offset);

    //获取所有的分类订单
    List<DeliveryOrders> selectStatusPending();
    List<DeliveryOrders> selectStatusProcessing(Long delivererId);
    List<DeliveryOrders> selectStatusDeliverying(Long delivererId);
    List<DeliveryOrders> selectStatusCompleted(Long delivererId);



}
